<template>
  <div>setting page</div>
  <button @click="closeWin">CLOSE WINDOW</button>
  <!-- <router-link :to="{path: '/footer'}" target="_blank" tag="a">footer</router-link> -->
</template>
<script setup>

import { useRouter } from "vue-router";
const router = useRouter();


import { WebviewWindow } from '@tauri-apps/api/webviewWindow';

async function onCloseWindow () {
  // 获取窗口的引用
  try {
    const window = await WebviewWindow.getByLabel('settings');
    console.log(window)
    window?.close();
  } catch (err) {
    console.log(err)
  }
}

function closeWin () {
  // router.back()
  // router.go(-1)
  onCloseWindow()
}

</script>